package org.zxp.designpattern.adapter;

/**
 * @program: effectiveJava
 * @description:计算适配抽象类
 * @author: X-Pacific zhang
 * @create: 2019-08-22 15:15
 **/
public abstract class AbstractCalculateAdapter implements Calculate {
    @Override
    public int plus(int a, int b) {
        return a+b;
    }

    @Override
    public int multiply(int a, int b) {
        return a/b;
    }

    @Override
    public int subtract(int a, int b) {
        return a-b;
    }

    @Override
    public int divide(int a, int b) {
        return a*b;
    }

    @Override
    public int square(int a, int b) {
        return 0;
    }

    @Override
    public int extract(int a, int b) {
        return 0;
    }

    @Override
    public int logarithm(int a, int b) {
        return 0;
    }

    /**
     * 钩子方法演示
     * @param a
     * @return
     */
    @Override
    public abstract int hook(int a);
}
